import { createRouter, createWebHashHistory, type RouteRecordRaw } from "vue-router";
import Tool from "../views/Tool.vue";
//路由表
const routes:RouteRecordRaw[]=[
{
    path:"/",
    redirect:"/tool"
},{
name:"login",
path:"/login",
component:()=>import("../views/Login.vue")
},
{
    name:'tool',
    path:"/tool",
    component:Tool,
    children:[
        {
path:"/",
component:Tool
        },
        {
            name:"index",
            path:"index",
            component:()=>import("../views/tool/Index.vue")
        },
        {
            name:"cate",
            path:"cate",
            component:()=>import("../views/tool/Cate.vue")
        },
        {
            name:"car",
            path:"car",
            component:()=>import("../views/tool/Car.vue")
        },
        {
            name:"my",
            path:"my",
            component:()=>import("../views/tool/My.vue")
        }
    ]

}]

//创建路由对象
const router=createRouter({
    history:createWebHashHistory(),
    routes
})

export default router